"""
@Project:p8项目
@File:create_app.py
@Author:柴奇峰
@Date:16:53
"""
from flask import Flask
from model import db
from flask_cors import CORS
from views.user import user_bp
from views.oauth_user import oauth_user_bp
from views.courses import courses_bp
from views.comment import comment_bp
from views.vip import vip_bp

def create_flask_app(config):
    app = Flask(__name__)

    CORS(app)

    db.init_app(app)

    app.config.from_object(config)
    app.register_blueprint(user_bp)
    app.register_blueprint(oauth_user_bp)
    app.register_blueprint(courses_bp)
    app.register_blueprint(comment_bp)
    app.register_blueprint(vip_bp)

    return app



